#include <iostream>
#include <memory>
#include <vector>
using std::cout;
using std::endl;
using std::unique_ptr;
using std::vector;

class Point
{
public:
    Point(int ix = 0, int iy = 0)
    : _ix(ix)
    , _iy(iy)
    {
        cout << "Point(int,int)" << endl;
    }

    void print() const{
        cout << "(" << _ix
            << "," <<_iy
            << ")" << endl;
    }

    ~Point(){
        cout << "~Point()" << endl;
    }

private:
    int _ix;
    int _iy;
};

void test0(){
    unique_ptr<int> up(new int(10));
    cout << "*up" << *up << endl;
    cout << "up.get():" << up.get() << endl;

    cout << endl;
}

void test1(){
    vector<unique_ptr<Point>> vec;
    //vec.push_back(unique_ptr<Point>(new Point(2,8)));
    //vec[1]->print();

    unique_ptr<Point> up(new Point(1,2));
    vec.push_back(std::move(up));
    vec[0]->print();

    vec.push_back(unique_ptr<Point>(new Point(2,8)));
    vec[1]->print();


}

int main(int argc, char * argv[])
{
    test1();
    return 0;
}


